package com.gary.controller;

import com.gary.entity.Employee;
import com.gary.mapper.IEmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author pengrui3
 * @date 2020/11/26-22:53
 */
@RestController
public class EmployeeController {

    @Autowired
    private IEmployeeMapper iEmployeeMapper;

    @Cacheable(value = "emp")
    @GetMapping("/empAll")
    public List<Employee> queryAll() {
        List<Employee> employees = iEmployeeMapper.queryAll();
        return employees;
    }
}
